package tonglian

import "encoding/xml"

type TlPayBodyTransDetail struct {
	Sn              string `xml:"SN"`
	EUserCode       string `xml:"E_USER_CODE"`
	BankCode        string `xml:"BANK_CODE"`
	AccountType     string `xml:"ACCOUNT_TYPE"`
	AccountNo       string `xml:"ACCOUNT_NO"`
	AccountName     string `xml:"ACCOUNT_NAME"`
	Provice         string `xml:"PROVINCE"`
	City            string `xml:"CITY"`
	BankName        string `xml:"BANK_NAME"`
	AccountProp     string `xml:"ACCOUNT_PROP"`
	Amount          string `xml:"AMOUNT"`
	Currency        string `xml:"CURRENCY"`
	Protocol        string `xml:"PROTOCOL"`
	ProtocolUserIId string `xml:"PROTOCOL_USERID"`
	IdType          string `xml:"ID_TYPE"`
	Id              string `xml:"ID"`
	Tel             string `xml:"TEL"`
	CustUserId      string `xml:"CUST_USERID"`
	Remark          string `xml:"REMARK"`
	Settacct        string `xml:"SETTACCT"`
	SettGroupFlag   string `xml:"SETTGROUPFLAG"`
	Summary         string `xml:"SUMMARY"`
	UnionBank       string `xml:"UNION_BANK"`
}

type TlPayBodyTransDetails struct {
	TransDetail []TlPayBodyTransDetail `xml:"TRANS_DETAIL"`
}

type TlPayBodyTransSum struct {
	BusinessCode string `xml:"BUSINESS_CODE"`
	MerchantId   string `xml:"MERCHANT_ID"`
	SubmitTime   string `xml:"SUBMIT_TIME"`
	TotalItem    string `xml:"TOTAL_ITEM"`
	TotalSum     string `xml:"TOTAL_SUM"`
	Settday      string `xml:"SETTDAY"`
}

type TlPayInfo struct {
	TrxCode  string `xml:"TRX_CODE"`
	Version  string `xml:"VERSION"`
	DataType string `xml:"DATA_TYPE"`
	Level    string `xml:"LEVEL"`
	UserName string `xml:"USER_NAME"`
	UserPass string `xml:"USER_PASS"`
	ReqSn    string `xml:"REQ_SN"`
}

type TlPayInfoSig struct {
	TlPayInfo
	SignedMsg string `xml:"SIGNED_MSG"`
}

type TlPayBody struct {
	TransSum     TlPayBodyTransSum     `xml:"TRANS_SUM"`
	TransDetails TlPayBodyTransDetails `xml:"TRANS_DETAILS"`
}

type TlPay struct {
	XMLName xml.Name  `xml:"AIPG"` // XML根节点名字
	Info    TlPayInfo `xml:"INFO"`
	Body    TlPayBody `xml:"BODY"`
}

type TlPaySig struct {
	XMLName xml.Name     `xml:"AIPG"` // XML根节点名字
	Info    TlPayInfoSig `xml:"INFO"`
	Body    TlPayBody    `xml:"BODY"`
}
